package org.jeecg.modules.power.timing;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.power.statistics.service.IYlHomeShopService;
import org.jeecg.modules.power.user.entity.YlUser;
import org.jeecg.modules.power.user.service.IYlUserService;
import org.jeecg.modules.power.util.userutil.MemberUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * @BelongsProject: jeecg-boot-parent
 * @BelongsPackage: org.jeecg.modules.power.timing
 * @Author: mi
 * @CreateTime: 2024-07-15 10:30
 * @Description:
 */
@Component
@Configuration      //1.主要用于标记配置类，兼备Component的效果。
@EnableScheduling   // 2.开启定时任务
public class MemberTimeDate {
    @Autowired
    private IYlUserService ylUserService;
    @Autowired
    private MemberUserUtil memberUserUtil;//任务


    @Autowired
    private IYlHomeShopService ylHomeShopService;//APP 首页门店统计

    /**
     * 会员到期 改为不是会员
     */
//    @Scheduled(cron = "0 0/1 * * * ?")//每1分钟执行一次
    @Scheduled(cron = "0 0 1 * * ?")//每天凌晨 1点 执行任务
    private void memberTime(){
        //定时任务 生成门店统计数据
        ylHomeShopService.addHomeShopEnt();

        //执行会员过期任务
        memberUserUtil.startMemberUserTask();





    }
}
